package com.res.common.controller;

import org.springframework.stereotype.Controller;
//import org.springframework.ui.ModelMap;
//import org.springframework.validation.BindingResult;
//import org.springframework.web.bind.annotation.ModelAttribute;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RequestParam;
//
//import com.res.simulator.handler.ConsumeAPIHandler;
//import com.res.simulator.handler.ScanPageHandler;
//import com.res.simulator.handler.SelectApiHandler;
//import com.res.simulator.model.GenericAPIExecutionModel;
//import com.res.simulator.model.SavedAPIModel;
//import com.res.simulator.model.WADLScanModel;
//import com.res.simulator.view.SaveApiView;

@Controller
public class PersistanceAPILoader {

//	@RequestMapping(value="/selectAPIString", method=RequestMethod.GET)
//	public String searchAPI(@ModelAttribute("SavedAPIMode") final SavedAPIModel model,final BindingResult result) {
//		System.out.println("=========================/search/");
//		return "apipopuplayout";
//		
//	}
//	
//	@RequestMapping(value="/selectAPIString", method=RequestMethod.POST)
//	public String selectAPI(@ModelAttribute("GenericAPIExecutionModel") final GenericAPIExecutionModel model,final BindingResult result)  throws Exception{
//		System.out.println("=========================/select");
////		SavedAPIModel apimodel = new SavedAPIModel();
////		apimodel.setApiName("getOffers");
////		apimodel.setParams(new String[]{"param1", "param2"});
////		//model.put("apimodel", apimodel);
//		SelectApiHandler sap=new SelectApiHandler();
//		//SaveApiView saveApiView=sap.process(model);
//		//GenericAPIExecutionModel gapi=new GenericAPIExecutionModel();
//		//model.put("GenericAPIExecutionModel", gapi);
//		//System.out.println(saveApiView.getPrintMessage()+">>>>>>>>>>>>>>>>>testing testing");
//		return "genericapiexecutionlayout";
//		
//	}
	
//    @RequestMapping(value="/saveAPIString", method=RequestMethod.GET)
//    public String viewAPIString(@ModelAttribute("SavedAPIModel") final SavedAPIModel model,final BindingResult result) {
//		System.out.println("=========================/VIEW");
//
//		return "apiStringEditLayout";
//	}
//	
//	@RequestMapping(value="/saveAPIString", method=RequestMethod.POST)
//	public String viewAPIString(@ModelAttribute("GenericAPIExecutionModel") final GenericAPIExecutionModel model,final BindingResult result) throws Exception {
//		System.out.println("=========================/SAVE");
//
//		
//		ConsumeAPIHandler consumehandler=new ConsumeAPIHandler();
//		SaveApiView saveApiView=consumehandler.process(model);
//	
//		System.out.println(saveApiView.getPrintMessage()+">>>>>>>>>>>>>>>>>here should be a value");
//		return "genericapiexecutionlayout";
//	}
}
